/**
 * 	Copyright 2009 RJ Regenold 
 *	
 *	Licensed under the Apache License, Version 2.0 (the "License"); 
 *	you may not use this file except in compliance with the License. 
 *	You may obtain a copy of the License at 
 *	
 *		http://www.apache.org/licenses/LICENSE-2.0 
 *		
 *	Unless required by applicable law or agreed to in writing, software 
 *	distributed under the License is distributed on an "AS IS" BASIS, 
 *	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 *	See the License for the specific language governing permissions and 
 *	limitations under the License. 
 */

package com.binarylion.puremvc.core {
	
	import com.binarylion.controller.GreetingCommand;
	import com.binarylion.puremvc.registration.CatchAllHandler;
	import com.binarylion.puremvc.registration.ObjectIdHandler;
	
	import flexunit.framework.TestCase;
	
	import org.springextensions.actionscript.context.support.XMLApplicationContext;
	
	public class FountControllerTest extends TestCase {
		
		{
			GreetingCommand;
			ObjectIdHandler;
			CatchAllHandler;
		}
		
		public function FountControllerTest(methodName:String=null) {
			super(methodName);
		}
		
		override public function setUp():void {
			var a:XMLApplicationContext = new XMLApplicationContext();
			a.addEmbeddedConfig(_configSource);
			a.load();
			c = FountController.getInstance();
			assertTrue('c must be of type FountController', c is FountController); 
			c.appContext = a;
		}
		
		public function testRegisterCommand():void {
			c.rc('note 1', 'greetingCommand');
		}
		
		protected var c:FountController;
		
		[Embed(source="/test-app-context.xml",mimeType ="application/octet-stream")]
		protected var _configSource:Class;
	}
}